<?php


namespace app\common\controller;

use app\BaseController as BaseController;
use app\shop\model\GoodsUnit as UnitModel;
use app\shop\model\Goods as GoodsModel;

class Task extends  BaseController
{


    /**
     * 从金蝶同步单位信息
     * @author Mr.Li
     * @create 2021-07-12 16:53
     */
    public function syncKingdeeUnit()
    {
        $unitModel = new UnitModel();
        $data      = $unitModel->syncKingdeeUnit();
        if (!$data) {
            return resultArray(['error' => '同步失败']);
        }
        return resultArray(['data' => [],'error' => '同步成功']);
    }


    /**
     * 从金蝶同步库存数据
     * @return \think\response\Json
     * @author Mr.Li
     * @create 2021-07-12 16:58
     */
    public function syncKingdeeStock()
    {
        $goodsModel = new GoodsModel();
        $data      = $goodsModel->syncKingdeeStock();
        if (!$data) {
            return resultArray(['error' => '同步失败']);
        }
        return resultArray(['data' => [],'error' => '同步成功']);
    }

}
